#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
using namespace std;
class solution {
public:
	void reSortArray(vector<int>& array) {
		if (array.empty()) {
			return;
		}
		int k = 0;
		for (int i = 0; i < array.size(); ++i) {
			if (array[i] & 1) {
				int tmp = array[i];
				int j = i;
				while (j > k) {
					array[j] = array[j - 1];
					j--;
				}
				array[k++] = tmp;
			}
		}
		for (int i = 0; i < array.size(); i++) {
			cout << array[i] << " ";
		}
		cout << endl;
	}
};
int main() {
	solution s;
	vector<int> array = { 1,2,3,4,5,6 };
	s.reSortArray(array);
}